//
//  MainBusinessTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/12.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "MainBusinessTableViewCell.h"

@interface MainBusinessTableViewCell ()
@property (nonatomic, strong) GLGWLabel *mainLabel;
@property (nonatomic, strong) GLGWLabel *miaoshuLabel;
@end

@implementation MainBusinessTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.mainLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:self.contentView];
        self.mainLabel.text = @"主营业务";
        [self.mainLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(20));
            make.right.equalTo(self.contentView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(15));
        }];
        
        self.miaoshuLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self.contentView];
        self.miaoshuLabel.text = @"热镀锌钢管、直缝焊接钢管、内衬塑复合钢管";
        [self.miaoshuLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.left.and.right.equalTo(self.mainLabel);
            make.top.equalTo(self.mainLabel.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(15));
            make.bottom.equalTo(@(-kHeightProportion_In_iPhoneTriploid(20)));
        }];
        self.miaoshuLabel.numberOfLines = 0;
    }
    return self;
}

- (void)setModel:(StoreIntroduceModel *)model
{
    _model = model;
    StoreIntroduceDataModel *dataModel = model.data;
    NSString *str = @"暂无主营业务";
    if (dataModel.mainProduct.length > 0) {
        str = dataModel.mainProduct;
    }
    self.miaoshuLabel.text = str;
}

@end
